package com.tianji.learning.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.learning.domain.po.Noes;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xzh
 * @since 2024-03-27
 */
public interface NoesMapper extends BaseMapper<Noes> {

    /**
     * 减少采集数
     * @param id
     */
    @Update("update noes set used_times=used_times-1 where id=#{id}")
     void removeUsedTimes(Long id);

    /**
     * 增加采集数
     * @param id
     */
    @Update("update noes set used_times=used_times+1 where id=#{id}")
     void saveUsedTimes(Long id);
}
